<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function* gen() {
        console.log(111);
        yield '一只没有耳朵';
        console.log(222);
        yield '一只没有尾巴';
        console.log(333);
        yield '真奇怪';
        console.log(444);
    }

    let iterator = gen();

    console.log(iterator.next()); // 111

</script>

</html>